<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        // 1.var声明变量，创建空间
        var age;
        // 2.变量赋值
        age = 23;
        // 3.输出结果
        console.log(age);

        //直接声明变量并赋值也可以，即变量的初始化
        var age2 = 24;
        alert(age2);
    </script>

</head>

<body>

</body>

</html>